Skip to content

fix(appearance): changed divider colors also paint workspace splits - #37342

Merged
nwparker merged 2 commits into
mainfrom
nwparker/theme-split-divider-setting
Nov 2, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/theme-split-divider-setting

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​33

Summary

Settings → Appearance → Dark/Light Divider Color says it controls "the split divider line between panes", but it only painted splits inside a terminal tab. The workspace tab-group split (terminal | editor, stacked groups) always used the --split-divider token.

Now, when a divider color is changed from its default, the tab-group split uses it too. At the default nothing changes.

How "changed" is detected: the stored value is compared (case-insensitively) with the shipped default (#3f3f46 dark / #d4d4d8 light). No new setting, schema change or migration.

Precedence: user setting → theme token --split-divider → built-in 3:1 color. useSplitDividerSetting sets --split-divider-setting on :root only when the color differs from its default and is a valid CSS color. Otherwise it removes the property. The split reads var(--split-divider-setting, var(--split-divider)), so a plugin theme's inline --split-divider still wins over the built-in color.

Which slot (dark or light): the same one the terminal panes use (selectTerminalTheme(...).useLightVariant). With "Use separate light theme" off, Settings shows only the dark field and the panes use it, so the split follows it too.

Builds on #14893 by @mmarabel. That PR added separate tab-group divider settings; this version reuses the existing divider settings instead, with no new keys.

Closes #14887

Visual proof

Dark divider set to #ef4444, light divider set to #2563eb. The "before" shots come from the same profile running origin/main's code.

Before (main) After
Dark before dark after dark
Light before light after light

At the default settings the computed split color is unchanged: rgb(113,113,122) dark and rgb(134,134,144) light, both before and after. --split-divider-setting is not set.

after dark default

Merge-risk assessment: Low

  • Renderer only: about 30 lines, plus one CSS var() fallback.
  • No settings keys, IPC or schema changes. Mixed client/server versions are unaffected because settings stay local to the renderer.
  • At the default the property is never set, so rendering is byte-identical to main.
  • Invalid stored values fail CSS.supports('color', …) and fall back to the theme or built-in color.
  • Mobile has no tab-group splits, and folder workspaces are unaffected.

Negative user-facing tradeoffs

  • Users who changed their divider color long ago (for example a near-black #171717) will now see that color on the workspace split as well. It may have less contrast on --card than the built-in 3:1 default. This is what [Feature]: Make the workspace tab-group split divider color configurable #14887 asks for, and resetting the setting restores the default.
  • Choosing a color that equals the default exactly is treated as "unchanged", so the split keeps the built-in or theme color.
  • Hover and drag still use --split-divider-hover. A custom divider color does not tint the hover state.
  • With "Use separate light theme" off, a custom dark divider color also paints the split in light mode, matching what the terminal panes do.

Validation

  • pnpm tc:web passes. oxlint and oxfmt pass on the changed files. pnpm test src/renderer/src/app-shell/use-document-appearance.test.tsx src/renderer/src/lib/terminal-theme.test.ts passes (26 tests).
  • Real app: dev build launched in the background (ORCA_BACKGROUND_LAUNCH=1) with a throwaway userData and HOME, driven over CDP. Checked computed ::after colors of .tab-group-split-resize-handle:
    • Dark with a custom color shows the custom color. Light with a custom color shows the custom color.
    • Light with "separate light theme" off uses the dark custom color, the same as the panes.
    • Default values set nothing, both before and after. Uppercase defaults (#3F3F46) also set nothing.
    • A non-color value sets nothing.
    • Inline theme --split-divider with the setting at default: the theme color shows. With a custom setting: the setting wins.
  • Review: one Opus sub-agent and Codex (gpt-6.1-sol, xhigh). Both flagged choosing the slot from the app mode instead of the terminal slot; fixed. Codex also flagged lowercasing breaking a case-sensitive var(--X) value; fixed (the value is lowercased only for the default comparison).

Perf

Scanned with the perf-scan skill: the diff and the useDocumentAppearance subscriber path.

  • Two primitive zustand selectors with O(1) work, selectTerminalTheme being a few string comparisons, plus one effect keyed on [color, light].
  • Measured over CDP with the dev build: 50 unrelated settings writes caused 0 effect runs (counted setProperty/removeProperty calls for --split-divider-setting) and 0 style recalcs. Changing the divider color caused 1 effect run and about 16 style recalcs totalling about 7 ms. Main also repaints the terminal panes on that same change, and it is a user-driven settings action.
  • No cost at the default: no inline property is set, and the CSS change only adds a fallback.
  • No timers, listeners or platform-specific paths.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cebbd552-7479-4415-92ee-2d964915febc
Commits

Reviewing files that changed from the base of the PR and between 337cfcf and 4556d9b.

Files selected for processing: 4
  • src/renderer/src/app-shell/use-document-appearance.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/hooks/use-split-divider-setting.ts
  • src/renderer/src/lib/terminal-theme.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19889911-c717-4bcc-94fb-e63b5cde1612
Commits

Reviewing files that changed from the base of the PR and between 8d1453f and df77a75.

Files selected for processing: 4
  • src/renderer/src/app-shell/use-document-appearance.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/hooks/use-split-divider-setting.ts
  • src/renderer/src/lib/terminal-theme.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Walkthrough

The appearance hook now applies the terminal divider color setting to the workspace split divider. The hook sets a document-level CSS property when the selected color is supported, nonblank, and different from the variant default. The divider uses that property when present and otherwise uses its existing CSS token. The light divider default is now exported.

Merge Risk: Minimal · previous review df77a

The workspace divider setting is appropriately applied without an identified merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the appearance fix and the application of changed divider colors to workspace splits.
Description check Passed The description is detailed and covers the user impact, implementation, issue link, visual proof, validation, performance, compatibility, and risk. It uses different headings from the template and omi…
Linked Issues check Passed [#14887] The Expected section requires a user-facing dark and light divider color control that covers the workspace tab-group split (.tab-group-split-resize-handle), with a suitable default. The diff …
Out of Scope Changes check Passed The whole-PR diff against the merge base changes four renderer files, and each change supports the divider-color objective of #14887:
- main.css: adds the --split-divider-setting fallback on the tab-g…
Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, issue link, visual proof, validation, performance, compatibility, and risk. It uses different headings from the template and omits some checklist sections, but the required decision-making information is present.

Full details: Linked Issues check

Explanation

[#14887] The Expected section requires a user-facing dark and light divider color control that covers the workspace tab-group split (.tab-group-split-resize-handle), with a suitable default. The diff meets this:

  • src/renderer/src/assets/main.css: the handle background changes from var(--split-divider) to var(--split-divider-setting, var(--split-divider)). The built-in token stays the fallback.
  • src/renderer/src/hooks/use-split-divider-setting.ts (new): selects terminalDividerColorDark or terminalDividerColorLight by the terminal theme variant. It sets --split-divider-setting on the document root only when the trimmed value differs from the shipped default (case-insensitive), passes CSS.supports('color', value), and is not empty. Otherwise it removes the property. The default therefore keeps the existing #71717a / #868690 workspace color.
  • src/renderer/src/app-shell/use-document-appearance.ts: calls useSplitDividerSetting() so the hook runs in the app-wide appearance path.
  • src/renderer/src/lib/terminal-theme.ts: exports DEFAULT_TERMINAL_DIVIDER_LIGHT for the comparison.
    The issue warns against binding the terminal keys as the workspace default. The PR does not do that. It uses the terminal keys only as an override when the value differs from the default.

Deviations from the issue's suggested approach (not stated requirements): the PR reuses the existing terminal divider settings instead of adding tab-group settings, adds no Window & Sidebar UI, and does not add a stronger hover/drag variant. Hover and drag still use --split-divider-hover. The issue labels the approach 'Suggested approach (small)'. The PR description and linked-issue objectives both state this difference. The Expected behavior is met.

No automated test was added for the new hook. The issue does not require one. The author reports CDP checks and existing test runs.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes four renderer files, and each change supports the divider-color objective of #14887:

  • main.css: adds the --split-divider-setting fallback on the tab-group split handle. This is the consuming side of the objective.
  • use-split-divider-setting.ts: new hook that maps the stored setting to a CSS custom property. This is the core of the change.
  • use-document-appearance.ts: adds one hook call so the property is applied app-wide.
  • terminal-theme.ts: exports an existing constant used by the new hook's default comparison.
    The PR adds no settings keys, IPC, schema, or migration changes. It touches no unrelated code paths. The PR description notes that the terminal pane rendering is unchanged at the default.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nwparker
nwparker force-pushed the nwparker/theme-split-divider-setting branch 2 times, most recently from 337cfcf to fa60b8b Compare November 2, 2026 06:23
@nwparker
nwparker force-pushed the nwparker/theme-split-divider-setting branch from fa60b8b to 4556d9b Compare November 2, 2026 06:35
@nwparker
nwparker merged commit 7209988 into main Nov 2, 2026
42 checks passed
@nwparker
nwparker deleted the nwparker/theme-split-divider-setting branch November 2, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Make the workspace tab-group split divider color configurable

1 participant